#include "projectInfo.h"
#include <QFileDialog>

projectInfo::projectInfo(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	ui.dateEdit->setDateTime(QDateTime::currentDateTime());
	connect(ui.pushButton_create, &QPushButton::clicked, this, &projectInfo::OnPushbutton_create_clicked);
	connect(ui.btnPathSelect, &QPushButton::clicked, this, &projectInfo::OnPushbutton_selectConfigFile_clicked);
}

projectInfo::~projectInfo()
{}

void projectInfo::OnPushbutton_create_clicked()
{
	emit signalCreate();
}

void projectInfo::OnPushbutton_selectConfigFile_clicked()
{
	QString filePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("选择文件"), "", QString::fromLocal8Bit("Excel 文件 (*.xlsx)"));

	if (!filePath.isEmpty()) {
		// 在这里处理选中的文件路径
		ui.lineEdit_protocalPath->setText(filePath);
	}
}

QString projectInfo::getProjectName() const
{
	return ui.lineEdit_Pro->text();
}

QString projectInfo::getProtocalPath() const
{
	return ui.lineEdit_protocalPath->text();
}

QString projectInfo::getPeopleName() const
{
	return ui.lineEdit_People->text();
}

QDateTime projectInfo::getDateTime() const
{
	return ui.dateEdit->dateTime();
}
